

<template>
  <avue-form
    v-model="form"
    :option="option"
    @submit="submit"
  >
    <template
      slot-scope="scope"
      slot="fullAddress"
    >
      <el-input placeholder="请选择地址">
        <el-button
          slot="append"
          icon="el-icon-location"
        ></el-button>
      </el-input>
    </template>
  </avue-form>

</template>

<script>
/* eslint-disable */
import { mapGetters } from "vuex";
import crudMixin from '@/mixins/crud'
import options from "./options.js";
import { isNull, arr2pojo, obj2pojo, validateResponse } from "@/util/util";
import { successMsg, errorMsg } from "@/util/message";
import { field, reField } from "./field";


const DIC = {
  YoN: [{
    label: '否',
    value: 0
  }, {
    label: '是',
    value: 1
  }]
}

export default {
  name: "role",
  mixins: [crudMixin],
  components: {
  },
  data() {
    return {
      form: {
        bannerUrl: [
        ],
        avatarUrl: '',
      },
      option: {
        dicData: DIC,
        submitText: '完成',
        column: [
          {
            label: "店铺名称",
            prop: 'merchantName',
            type: 'input',
            span: 20
          },
          {
            label: "店铺头像",
            prop: "avatarUrl",
            type: "upload",
            showFileList: false,
            listType: 'picture-img',
            span: 20,
            action: '/api/v1/upload?type=image',
          },
          {
            label: 'Banner',
            prop: 'bannerUrl',
            type: 'upload',
            span: 20,
            listType: 'picture-card',
            tip: '只能上传jpg/png文件，且不超过500kb',
            action: '/api/v1/upload?type=image',
          },
          {
            label: "联系人",
            prop: 'contactName',
            type: 'input',
            span: 6
          },
          {
            label: "联系电话",
            prop: 'contactPhone',
            type: 'phone',
            span: 6
          },
          {
            label: "地址",
            prop: 'fullAddress',
            span: 20,
            formsolt: true
          },

          {
            label: "平均售价",
            prop: "avgPrice",
            type: 'number',
            minRows: 0,
            span: 6
          },
          {
            label: "运费",
            prop: "freight",
            type: 'number',
            minRows: 0,
            span: 6
          },
          {
            label: '店铺介绍',
			prop: 'description',
            component: "AvueUeditor",
            span: 20
          }]
      }
    }
  },
  created() {
    //初始化
	this.form.avatarUrl = "";
	this.handleShow()	
  },
  methods: {
    submit() {
      this.$message.success('当前数据' + JSON.stringify(this.form));
	},
	handleShow()
	{
		this.$store
        .dispatch("GetMerchantInfo", {})
        .then(
          res => {
            if (res.data.status == 1) {
              let _data = res.data.result.data || []
			  this.form = _data
            }
          }, error => {
          })
	},
	filterForm(data){
		
	}
  }
}
</script>
